
<div class="weui_cells">
	<div class="weui_cell weui_vcode">
		<div class="weui_cell_hd"><label class="weui_label">{title}</label></div>
		<div class="weui_cell_bd weui_cell_primary">
			<input class="weui_input" type="text" ng-model="{tovalue}.{name}" placeholder="{help}">
		</div>
		<div class="weui-cell-remark noremark"><a class="btn btn-default btn-default-o btn-sm" id="sms_code_{name}" ng-click="pagedata.send_smscode({tovalue}.{mobile_name})">获取验证码</a></div>
	</div>
</div>
<script>
scope.pagedata.send_smscode=function(mobile){
	if(!mobile){
		alert('请先填写手机号！');
		return false;
	}
	if(scope.pagedata.sending){
		return false;
	}
	var params={'data':{'mobile':mobile},'op':'send_verifycode','action':'member.mobile','plugin':'core'};
	params.callback=function(res){
		if(res=='success'){
			//发送成功，开始倒计时 
			scope.pagedata.sending=true;
			scope.count_down(60,'sms_code_{name}','秒后重新发送',function(){
				scope.pagedata.sending=false;
				$('#sms_code_{name}').text('重新发送');
			});
		}else{
			scope.message('验证码发送失败！');
		}
	}
	scope.post_json(params);
}
</script>